Component({
  properties: {
  },
  data: {
    language:'zh'
    // 组件内部数据
  },
  methods: {
    // 组件内部方法
    onFloatButtonTap: function() {
      this.triggerEvent('floatbuttontap'); // 触发自定义事件
    },
    updateParentData() {
      this.triggerEvent('floatbuttontap'); 
      const that = this;
      wx.showActionSheet({
          itemList: ['English', '中文','繁体'],
          success(res) {
              if (res.tapIndex === 0) {
                  that.setData({ language: 'en' });
                  that.triggerEvent('updateData',{newData:'en'}); 
              } else if (res.tapIndex === 1) {
                  that.setData({ language: 'zh' });
                  that.triggerEvent('updateData',{newData:'zh'}); 
              }else{
                that.setData({language:'tr'})
                that.triggerEvent('updateData',{newData:'tr'}); 
              }
              wx.setStorage({
                key: 'language',
                data: that.data.language,
                success: function (res) {
                }
              });
          }
      });
    },
  }
});